package com.example.speeddating.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.speeddating.entity.ArticleImage;
import com.example.speeddating.mapper.ArticleImageMapper;
import com.example.speeddating.service.ArticleImageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 * @author tina
 * @since 2023-06-28 11:14:33
 */
@Service
public class ArticleImageServiceImpl extends ServiceImpl<ArticleImageMapper, ArticleImage> implements ArticleImageService {


    @Autowired
    private ArticleImageMapper articleImageMapper;

    /**
     * 获取文章图片
     * @param articleId
     * @return
     */

    @Override
    public ArticleImage getArticleImage(long articleId) {
        QueryWrapper<ArticleImage> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("article_id",articleId);
        return articleImageMapper.selectOne(queryWrapper);
    }
}
